﻿@model ICurrentUserModel

@AddControls(

    !Model.UserName.IsNotEmpty()
    ? null
    : new Paragraph
        {
            new Literal (Str.Business.Services.User, true),
            new Literal (": "),
            new Span()
                .SetTitle(Model.UserName)
                .AddControls(new Literal(Model.UserName.ToLength(20, true))),
            new Italic()
                .SetTitle(Model.UserLogin)
                .AddControls(new Literal(" (" + Model.UserLogin.ToLength(20, true) + ")")),
        },

    // user role or login

    Model.CurrentStateEntity.IsNull()
    ? null
    : new Paragraph
        {
            new Literal(Model.CurrentStateDescription, true),
            new Literal (": "),
            new Anchor()
                .SetHref(Model.ChangeStateUrl)
                .SetAttribute(Attr.AccessKey, "r")
                .AddControls( new Literal(Model.CurrentStateEntity.ToDisplay()) ),
        },

    // culture

    new Paragraph
    {
        new Literal(Str.Business.Services.SelectedLanguage, true),
        new Literal(": "),
        new Literal(Culture),
    }
)